package com.iotechn.unimall.admin.api.warehouseLoss;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.WarehouseLossDO;
import com.iotechn.unimall.data.dto.warehouse.WarehouseLossDTO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;

/**
 * 仓库损耗表
 *
 * @author wxw
 * @email
 * @date 2020-04-13 11:50:57
 */
@HttpOpenApi(group = "admin.warehouseLoss", description = "")
public interface WarehouseLossService {

    @HttpMethod(description = "列表", permission = "warehouseLoss:warehouseloss:list", permissionParentName = "仓库管理", permissionName = "损耗管理")
    Page<WarehouseLossDO> list(
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @HttpParam(name = "lossCheckNo", description = "损耗单编号") String lossCheckNo,
            @HttpParam(name = "skuSearch", description = "商品搜索") String skuSearch,
            @HttpParam(name = "insertStartTime", description = "开始时间") String checkStartTime,
            @HttpParam(name = "insertEndTime", description = "结束时间") String checkEndTime,
            @HttpParam(name = "lossCheckState", description = "状态") String lossCheckState) throws ServiceException;

    @HttpMethod(description = "创建", permission = "warehouseLoss:warehouseloss:create", permissionParentName = "仓库管理", permissionName = "损耗管理")
    String create(
            @NotNull @HttpParam(name = "warehouseLossDTO", type = HttpParamType.COMMON, description = "") WarehouseLossDTO warehouseLossDTO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "修改", permission = "warehouseLoss:warehouseloss:update", permissionParentName = "仓库管理", permissionName = "损耗管理")
    String update(
            @NotNull @HttpParam(name = "warehouseLossDTO", type = HttpParamType.COMMON, description = "") WarehouseLossDTO warehouseLossDTO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除", permission = "warehouseLoss:warehouseloss:delete", permissionParentName = "仓库管理", permissionName = "损耗管理")
    String delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "删除Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "详情", permission = "warehouseLoss:warehouseloss:detail", permissionParentName = "仓库管理", permissionName = "损耗管理")
    WarehouseLossDTO detail(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "列出所有损耗")
    List<WarehouseLossDO> listAll() throws ServiceException;

    @HttpMethod(description = "确认", permission = "warehouseLoss:warehouseLoss:confirm", permissionParentName = "仓库管理", permissionName = "损耗管理")
    String confirm(
            @NotNull @HttpParam(name = "lossCheckId", description = "出库单ID") Long lossCheckId,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
}

